package com.dyz.leetcode._04_bitOperation;

public class _476_findComplement {
    public int findComplement(int num) {
        int mask = ~0;
        while((num & mask)>0){
            mask = mask<<1;
        }
        return (~mask)^num;
    }
}
